home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Libraries / C Internet Config / IC Resource ƒ / IC Headers ƒ / IC API Descriptions.h < prev    next >
Encoding:
Text File  |  1995-11-17  |  21.4 KB  |  367 lines  |  [TEXT/SPM ]

  1.     Set folders to a pointer to the folders to search.
  2.     Setting count to 0 and folders to nil is OK.
  3.     Searches the specified folders and then optionally the Preferences folder
  4.     in a unspecified manner.
  5. */
  6.  
  7. ICError ICChooseConfig(ICInstance inst);
  8. /*
  9.     Requires IC 1.2.
  10.     It is illegal to call this routine inside a ICBegin/End pair.
  11.     Requests the user to choose a configuration, typically using some
  12.     sort of modal dialog. If the user cancels the dialog the configuration
  13.     state will be unaffected.
  14. */
  15.  
  16. ICError ICChooseNewConfig(ICInstance inst);
  17. /*
  18.     Requires IC 1.2.
  19.     It is illegal to call this routine inside a ICBegin/End pair.
  20.     Requests the user to create a new configuration, typically using some
  21.     sort of modal dialog. If the user cancels the dialog the configuration
  22.     state will be unaffected.
  23. */
  24.  
  25. ICError ICGetConfigName(ICInstance inst,Boolean longname,StringPtr name);
  26. /*
  27.     Requires IC 1.2.
  28.     You must specify a configuration before calling this routine.
  29.     Returns a string that describes the current configuration at a user
  30.     level. Set longname to true if you want a long name, up to 255
  31.     characters, or false if you want a short name, typically about 32
  32.     characters.
  33.     The returned string is for user display only. If you rely on the
  34.     exact format of it, you will conflict with any future IC
  35.     implementation that doesn't use explicit preference files.
  36. */
  37.  
  38. ICError ICGetConfigReference(ICInstance inst,ICConfigRefHandle ref);
  39. /*
  40.     Requires IC 1.2.
  41.     You must specify a configuration before calling this routine.
  42.     Returns a self-contained reference to the instance's current
  43.     configuration.
  44.     ref must be a valid non-nil handle and it will be resized to fit the
  45.     resulting data.
  46. */
  47.  
  48. ICError ICSetConfigReference(ICInstance inst,ICConfigRefHandle ref,long flags);
  49. /*
  50.     Requires IC 1.2.
  51.     It is illegal to call this routine inside a ICBegin/End pair.
  52.     Reconfigures the instance using a configuration reference that was
  53.     got using ICGetConfigReference reference. Set the
  54.     icNoUserInteraction_bit in flags if you require that this routine
  55.     not present a modal dialog. Other flag bits are reserved and should
  56.     be set to zero.
  57.     ref must not be nil.
  58. */
  59.  
  60. ICError ICSpecifyConfigFile(ICInstance inst,FSSpec* config);
  61. /*
  62.     It is illegal to call this routine inside a ICBegin/End pair.
  63.     For use only by the IC application.
  64.     If you call this routine yourself, you will conflict with any
  65.     future IC implementation that doesn't use explicit preference files.
  66. */
  67.  
  68. /* ***** Getting Information ***** */
  69.  
  70. ICError ICGetSeed(ICInstance inst,long* seed);
  71. /*
  72.     You do not have to specify a configuration before calling this routine.
  73.     You do not have to be inside an ICBegin/End pair to call this routine.
  74.     Returns the current seed for the IC prefs database.
  75.     This seed changes each time a non-volatile preference is changed.
  76.     You can poll this to determine if any cached preferences change.
  77. */
  78.  
  79. ICError ICGetPerm(ICInstance inst,ICPerm* perm);
  80. /*
  81.     You do not have to specify a configuration before calling this routine.
  82.     Returns the access permissions currently associated with this instance.
  83.     While applications normally know what permissions they have,
  84.     this routine is designed for use by override components.
  85. */
  86.  
  87. ICError ICDefaultFileName(ICInstance inst,StringPtr name);
  88. /*
  89.     You do not have to specify a configuration before calling this routine.
  90.     You do not have to be inside an ICBegin/End pair to call this routine.
  91.     Returns the default file name for IC preference files.
  92.     Applications should never need to call this routine.
  93.     If you rely on information returned by this routine yourself,
  94.     you may conflict with any future IC implementation that doesn't use
  95.     explicit preference files.
  96.     The component calls this routine to set up the default IC file name.
  97.     This allows this operation to be intercepted by a component that has
  98.     captured us. It currently gets it from the component resource file.
  99.     The glue version is hardwired to "Internet Preferences".
  100. */
  101.  
  102. ICError ICGetComponentInstance(ICInstance inst,Ptr* component_inst);
  103. /*
  104.     Requires IC 1.2.
  105.     You do not have to specify a configuration before calling this routine.
  106.     You do not have to be inside an ICBegin/End pair to call this routine.
  107.     Returns noErr and the connection to the IC component,
  108.     if we're using the component.
  109.     Returns badComponenInstance and nil if we're operating with glue.
  110.     The component_inst parameter is a universal pointer to avoid
  111.     us having to include Component.[ph] (which is not available under
  112.     some development environments) in order to use IC.
  113. */
  114.  
  115. /* ***** Reading and Writing Preferences ***** */
  116.  
  117. ICError ICBegin(ICInstance inst,ICPerm perm);
  118. /*
  119.     You must specify a configuration before calling this routine.
  120.     It is illegal to call this routine inside a ICBegin/End pair.
  121.     Starting reading or writing multiple preferences.
  122.     A call to this must be balanced by a call to ICEnd.
  123.     Do not call WaitNextEvent between these calls.
  124.     The perm specifies whether you intend to read or read/write.
  125.     Only one writer is allowed per instance.
  126.     Note that this may open resource files that are not closed
  127.     until you call ICEnd.
  128. */
  129.  
  130. ICError ICGetPref(ICInstance inst,StringPtr key,ICAttr* attr,Ptr buf,long* size);
  131. /*
  132.     You must specify a configuration before calling this routine.
  133.     If you are getting or setting multiple preferences, you should place
  134.     these calls within an ICBegin/ICEnd pair.
  135.     If you call this routine outside of such a pair, it implicitly
  136.     calls ICBegin(inst, icReadOnlyPerm).
  137.     Reads the preference specified by key from the IC database to the
  138.     buffer pointed to by buf and size.
  139.     key must not be the empty string.
  140.     If buf is nil then no data is returned.
  141.     size must be non-negative.
  142.     attr and size are always set on return. On errors (except icTruncatedErr)
  143.     attr is set to ICattr_no_change and size is set to 0.
  144.     size is the actual size of the data.
  145.     attr is set to the attributes associated with the preference.
  146.     If this routine returns icTruncatedErr then the other returned
  147.     values are valid except that only the first size bytes have been
  148.     return. size is adjusted to reflect the true size of the preference.
  149.     Returns icPrefNotFound if there is no preference for the key.
  150. */
  151.  
  152. ICError ICSetPref(ICInstance inst,StringPtr key,ICAttr attr,Ptr buf,long size);
  153. /*
  154.     You must specify a configuration before calling this routine.
  155.     If you are getting or setting multiple preferences, you should place
  156.     these calls within an ICBegin/ICEnd pair.
  157.     If you call this routine outside of such a pair, it implicitly
  158.     calls ICBegin(inst, icReadWritePerm).
  159.     Sets the preference specified by key from the IC database to the
  160.     value pointed to by buf and size.
  161.     key must not be the empty string.
  162.     size must be non-negative. 
  163.     If buf is nil then the preference value is not set and size is ignored.
  164.     If buf is not nil then the preference value is set to the size
  165.     bytes pointed to by buf.
  166.     If attr is ICattr_no_change then the preference attributes are not set.
  167.     Otherwise the preference attributes are set to attr.
  168.     Returns icPermErr if the previous ICBegin was passed icReadOnlyPerm.
  169.     Returns icPermErr if current attr is locked, new attr is locked and buf <> nil.
  170. */
  171.  
  172. ICError ICFindPrefHandle(ICInstance inst,StringPtr key,ICAttr* attr,Handle prefh);
  173. /*
  174.     Requires IC 1.2.
  175.     You must specify a configuration before calling this routine.
  176.     If you are getting or setting multiple preferences, you should place
  177.     these calls within an ICBegin/ICEnd pair.
  178.     If you call this routine outside of such a pair, it implicitly
  179.     calls ICBegin(inst, icReadWritePerm).
  180.     This routine effectively replaces ICGetPrefHandle.
  181.     Reads the preference specified by key from the IC database into
  182.     a handle, prefh.
  183.     key must not be the empty string.
  184.     attr is set to the attributes associated with the preference.
  185.     You must set prefh to a non-nil handle before calling this routine.
  186.     If the preference does not exist, icPrefNotFoundErr is returned.
  187. */
  188.  
  189. ICError ICGetPrefHandle(ICInstance inst,StringPtr key,ICAttr* attr,Handle* prefh);
  190. /*
  191.     Requires IC 1.1.
  192.     You must specify a configuration before calling this routine.
  193.     If you are getting or setting multiple preferences, you should place
  194.     these calls within an ICBegin/ICEnd pair.
  195.     If you call this routine outside ofty string then URLs of that form are not allowed.
  196.     data points to the start of the text. It must not be nil.
  197.     len indicates the length of the text. It must be non-negative.
  198.     selStart and selEnd should be passed in as the current selection of
  199.     the text. This selection is given in the same manner as TextEdit,
  200.     ie if selStart = selEnd then there is no selection only an insertion
  201.     point. Also selStart ≤ selEnd and 0 ≤ selStart ≤ len and 0 ≤ selEnd ≤ len.
  202.     selStart and selEnd are returned as the bounds of the URL. If the
  203.     routine returns an error then these new boundaries may be
  204.     invalid but they will be close.
  205.     The incoming url handle must not be nil.  The resulting URL is normalised
  206.     and copied into the url handle, which is resized to fit.
  207. */
  208.  
  209. ICError ICLaunchURL(ICInstance inst,StringPtr hint,Ptr data,long len,long* selStart,long* selEnd);
  210. /*
  211.     Requires IC 1.1.
  212.     You must specify a configuration before calling this routine.
  213.     You do not have to be inside an ICBegin/End pair to call this routine.
  214.     Parses a URL out of the specified text and feeds it off to the
  215.     appropriate helper.
  216.     hint indicates the default scheme for URLs of the form "name@address".
  217.     If hint is the empty string then URLs of that form are not allowed.
  218.     data points to the start of the text. It must not be nil.
  219.     len indicates the length of the text. It must be non-negative.
  220.     selStart and selEnd should be passed in as the current selection of
  221.     the text. This selection is given in the same manner as TextEdit,
  222.     ie if selStart = selEnd then there is no selection only an insertion
  223.     point. Also selStart ≤ selEnd and 0 ≤ selStart ≤ len and 0 ≤ selEnd ≤ len.
  224.     selStart and selEnd are returned as the bounds of the URL. If the
  225.     routine returns an error then these new boundaries may be
  226.     invalid but they will be close.
  227.     The URL is parsed out of the text and passed off to the appropriate
  228.     helper using the GURL AppleEvent.
  229. */
  230.  
  231. /* ***** Mappings Routines *****
  232.  * 
  233.  * Routines for interrogating mappings database.
  234.  * 
  235.  * ----- High Level Routines -----
  236.  */
  237.  
  238. ICError ICMapFilename(ICInstance inst,StringPtr filename,ICMapEntry* entry);
  239. /*
  240.     Requires IC 1.1.
  241.     You must specify a configuration before calling this routine.
  242.     If you are getting or setting multiple preferences, you should place
  243.     these calls within an ICBegin/ICEnd pair.
  244.     If you call this routine outside of such a pair, it implicitly
  245.     calls ICBegin(inst, icReadWritePerm).
  246.     Takes the name of an incoming file and returns the most appropriate
  247.     mappings database entry, based on its extension.
  248.     filename must not be the empty string.
  249.     Returns icPrefNotFoundErr if no suitable entry is found.
  250. */
  251.  
  252. ICError ICMapTypeCreator(ICInstance inst,OSType fType,OSType fCreator,StringPtr filename,ICMapEntry* entry);
  253. /*
  254.     Requires IC 1.1.
  255.     You must specify a configuration before calling this routine.
  256.     You must be inside an ICBegin/End pair to call this routine.
  257.     Takes the type and creator (and optionally the name) of an outgoing
  258.     file and returns the most appropriate mappings database entry.
  259.     The filename may be either the name of the outgoing file or
  260.     the empty string.
  261.     Returns icPrefNotFoundErr if no suitable entry found.
  262. */
  263.  
  264. /* ----- Mid Level Routines ----- */
  265.  
  266. ICError ICMapEntriesFilename(ICInstance inst,Handle entries,StringPtr filename,ICMapEntry* entry);
  267. /*
  268.     Requires IC 1.1.
  269.     You must specify a configuration before calling this routine.
  270.     You do not have to be inside an ICBegin/End pair to call this routine.
  271.     Takes the name of an incoming file and returns the most appropriate
  272.     mappings database entry, based on its extension.
  273.     entries must be a handle to a valid IC mappings database preference.
  274.     filename must not be the empty string.
  275.     Returns icPrefNotFoundErr if no suitable entry is found.
  276. */
  277.  
  278. ICError ICMapEntriesTypeCreator(ICInstance inst,Handle entries,OSType fType,OSType fCreator,StringPtr filename,ICMapEntry* entry);
  279. /*
  280.     Requires IC 1.1.
  281.     You must specify a configuration before calling this routine.
  282.     You do not have to be inside an ICBegin/End pair to call this routine.
  283.     Takes the type and creator (and optionally the name) of an outgoing
  284.     file and returns the most appropriate mappings database entry.
  285.     entries must be a handle to a valid IC mappings database preference.
  286.     The filename may be either the name of the outgoing file or
  287.     the empty string.
  288.     Returns icPrefNotFoundErr if no suitable entry found.
  289. */
  290.  
  291. /* ----- Low Level Routines ----- */
  292.  
  293. ICError ICCountMapEntries(ICInstance inst,Handle entries,long* count);
  294. /*
  295.     Requires IC 1.1.
  296.     You must specify a configuration before calling this routine.
  297.     You do not have to be inside an ICBegin/End pair to call this routine.
  298.     Counts the number of entries in the mappings database.
  299.     entries must be a handle to a valid IC mappings database preference.
  300.     count is set to the number of entries.
  301. */
  302.  
  303. ICError ICGetIndMapEntry(ICInstance inst,Handle entries,long ndx,long* pos,ICMapEntry* entry);
  304. /*
  305.     Requires IC 1.1.
  306.     You must specify a configuration before calling this routine.
  307.     You do not have to be inside an ICBegin/End pair to call this routine.
  308.     Gets the ndx'th entry in the mappings database.
  309.     entries must be a handle to a valid IC mappings database preference.
  310.     ndx must be in the range from 1 to the number of entries in the database.
  311.     The value of pos is ignored on input. pos is set to the position of
  312.     the ndx'th entry in the database and is suitable for passing back
  313.     into ICSetMapEntry.
  314.     Does not return any user data associated with the entry.
  315. */
  316.  
  317. ICError ICGetMapEntry(ICInstance inst,Handle entries,long pos,ICMapEntry* entry);
  318. /*
  319.     Requires IC 1.1.
  320.     You must specify a configuration before calling this routine.
  321.     You do not have to be inside an ICBegin/End pair to call this routine.
  322.     Returns the entry located at position pos in the mappings database.
  323.     entries must be a handle to a valid IC mappings database preference.
  324.     pos should be 0 to get the first entry. To get the subsequent entries, add
  325.     entry.total_size to pos and iterate.
  326.     Does not return any user data associated with the entry.
  327. */
  328.  
  329. ICError ICSetMapEntry(ICInstance inst,Handle entries,long pos,ICMapEntry* entry);
  330. /*
  331.     Requires IC 1.1.
  332.     You must specify a configuration before calling this routine.
  333.     You do not have to be inside an ICBegin/End pair to call this routine.
  334.     Sets the entry located at position pos in the mappings database.
  335.     entries must be a handle to a valid IC mappings database preference.
  336.     pos should be either a value returned from ICGetIndMapEntry or a value
  337.     calculated using ICGetMapEntry.
  338.     entry is a var parameter purely for stack space reasons. It is not
  339.     modified in any way.
  340.     Any user data associated with the entry is unmodified.
  341. */
  342.  
  343. ICError ICDeleteMapEntry(ICInstance inst,Handle entries,long pos);
  344. /*
  345.     Requires IC 1.1.
  346.     You must specify a configuration before calling this routine.
  347.     You do not have to be inside an ICBegin/End pair to call this routine.
  348.     Deletes the mappings database entry at pos.
  349.     entries must be a handle to a valid IC mappings database preference.
  350.     pos should be either a value returned from ICGetIndMapEntry or a value
  351.     calculated using ICGetMapEntry.
  352.     Also deletes any user data associated with the entry.
  353. */
  354.  
  355. ICError ICAddMapEntry(ICInstance inst,Handle entries,ICMapEntry* entry);
  356. /*
  357.     Requires IC 1.1.
  358.     You must specify a configuration before calling this routine.
  359.     You do not have to be inside an ICBegin/End pair to call this routine.
  360.     Adds an entry to the mappings database.
  361.     entries must be a handle to a valid IC mappings database preference.
  362.     The entry is added to the end of the entries database.
  363.     No user data is added.
  364. */
  365. #endif
  366.